import request from '../request'

// 添加图书至购物车
function addBookToCartApi(data) {
    return request({
        url: '/api/AddOrder',
        method: 'post',
        data
    })
}

// 获取购物车列表
function getCartListApi(data) {
    return request({
        url: '/api/cart',
        method: 'post',
        data
    })
}

// 单个删除购物车数据
function deleteCartApi(data){
    return request({
        url: '/api/DeleteOrder',
        method: 'post',
        data
    })
}

// 更新购物车count/stock sales
function updateCartApi(data){
    return request({
        url: '/api/EditOrder',
        method: 'post',
        data
    })
}

// 更新订单状态
function updateOrderStatusApi(data){
    return request({
        url: '/api/UpdateOrderStatus',
        method: 'post',
        data
    })
}

const result = {
    addBookToCartApi,
    getCartListApi,
    deleteCartApi,
    updateCartApi,
    updateOrderStatusApi
}

export default result;